extends Node2D
@export var enemy_scene:PackedScene
@export var timeout:float = 5
@export var max_create: int = 2
@onready var timer:Timer = $Timer
var current_create = 0
func _ready():
	timer.start(timeout)
	
func _on_timer_timeout():
	var enemy = enemy_scene.instantiate()
	enemy.global_position = global_position
	get_parent().add_child(enemy)
	
	current_create += 1
	if current_create >= max_create:
		timer.stop()
		
